package com.huang.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 角色信息表
 * </p>
 *
 * @author kaiji
 * @since 2019-08-17
 */
@Data
@NoArgsConstructor
@TableName("sys_role")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class Role extends BaseEntity {

    /**
     * 角色名称
     */
    @TableField("name")
    @NotNull(message = "请输入角色名称！")
    @Length(min = 2, max = 25, message = "名称是2到25个字符之间！")
    private String name;

    @TableField("code")
    @NotBlank(message = "请输入角色代码！")
    private String code;
}
